
#for tkinter's universal widget methods
#http://infohost.nmt.edu/tcc/help/pubs/tkinter/universal.html
#circular reference, but python's gc will collect it

#these aren't guarenteed to be available for wxWidgets

class RWindowUtil():
	def __init__(self, _tkwidget):
		self._tkwidget=tkwidget
	
	
	def beep(self):
		"""Generate a sound (typically a short beep)."""
		return self._tkwidget.bell()
	
	def get_clipboard(self):
		"""Returns the contents of the clipboard, as a string. Returns None if the clipboard contents are not a string."""
		try:
			return self._tkwidget.clipboard_get()
		except TclError:
			return None
		
	def set_clipboard(self, strText):
		"""Set the contents of the clipboard (with a string)."""
		self._tkwidget.clipboard_clear()
		self._tkwidget.clipboard_append(strText)

	def update(self):
		"""Some tasks in updating the display, such as resizing and redrawing widgets."""
		self._tkwidget.update_idletasks()
		
	def display_depth(self):
		"""Returns the number of bits per pixel in w's display."""
		return self._tkwidget.winfo_depth()
		
	def display_size(self):
		"""Returns the width and height of screen in millimeters, as a tuple."""
		return self._tkwidget.winfo_screenmmwidth(), self._tkwidget.winfo_screenmmheight()
		
	def display_resolution(self):
		"""Returns the width and height of screen in pixels, as a tuple."""
		return self._tkwidget.winfo_screenwidth(), self._tkwidget.winfo_screenheight()
		
	def get_mouse_coords(self):
		"""Returns a tuple (x, y) containing the coordinates of the mouse pointer relative to w's root window. If the mouse pointer isn't on the same screen, returns (-1, -1).."""
		return self._tkwidget.winfo_pointerxy()
		
	
	
	